Skip to content

Proposing removal of env.configFilePath and env.secretsFilePath#120

Merged
nikolasrieble merged 1 commit intohashicorp:mainfrom
USA-RedDragon:remove-local-files
Jul 1, 2025
Merged

Proposing removal of env.configFilePath and env.secretsFilePath#120
nikolasrieble merged 1 commit intohashicorp:mainfrom
USA-RedDragon:remove-local-files

Conversation

@USA-RedDragon
Copy link
Copy Markdown
Contributor

@USA-RedDragon USA-RedDragon commented Mar 14, 2025

Fixes #121

I noticed while on a screen sharing session with a customer that these options do not work unless you helm install . from a local copy of this chart. When utilized with our Helm registry, (i.e. helm install hashicorp/terraform-enterprise), no files outside of the ones already in this Git repo are able to be accessed.

This is because these values utilize .Files.Get in Helm
Per the Helm docs (https://helm.sh/docs/chart_template_guide/accessing_files/):

Some files cannot be accessed through the .Files object, usually for security reasons.
Files outside of a Helm application subchart, including those of the parent, cannot be accessed

Because of this, .env.configFilePath and env.secretsFilePath are only ever usable if you have a copy of this repo in your local directory when installing. When installing the Helm chart through the https://helm.releases.hashicorp.com release, because the chart is pulled from the HashiCorp repo, these files are not considered a part of the chart, causing .env.configFilePath and env.secretsFilePath to always be a no-op.

This has caused confusion on a support ticket, so I propose we remove these two values entirely.

Examples/proof:

Working because we edit the chart itself (install .)

echo 'TFE_HOSTNAME: "testing"' > env-config.yaml
helm template tfe . --set "env.configFilePath=`pwd`/env-config.yaml"

Not working because we are pulling from the HashiCorp repo

echo 'TFE_HOSTNAME: "testing"' > env-config.yaml
helm template tfe hashicorp/terraform-enterprise --set "env.configFilePath=`pwd`/env-config.yaml"

@USA-RedDragon USA-RedDragon requested a review from a team as a code owner March 14, 2025 15:50
nikolasrieble
nikolasrieble previously approved these changes Jun 30, 2025
Copy link
Copy Markdown
Contributor

@nikolasrieble nikolasrieble left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These were likely helpers that we added for our own developers convenience. As they are misleading for the customer, I agree with the proposal to remove them.

@USA-RedDragon Could you please resolve the merge conflicts? I will then happily merge.

These utilize `.Files.Get` in Helm
Per the Helm docs (https://helm.sh/docs/chart_template_guide/accessing_files/):
> Some files cannot be accessed through the .Files object, usually for security reasons.
> Files outside of a Helm application subchart, including those of the parent, cannot be accessed

Because of this, `.env.configFilePath` and `env.secretsFilePath` are only ever usable if you have a copy of this repo in your local directory when installing. When installing the Helm chart through the https://helm.releases.hashicorp.com release, because the chart is pulled from the HashiCorp repo, these files are not considered a part of the chart, causing `.env.configFilePath` and `env.secretsFilePath` to always be a no-op.

This has caused confusion on a support ticket, so I propose we remove these two values entirely.

Examples/proof:

Working because we edit the chart itself (install `.`)
```bash
echo 'TFE_HOSTNAME: "testing"' > env-config.yaml
helm template tfe . --set "env.configFilePath=`pwd`/env-config.yaml"
```

Not working because we are pulling from the HashiCorp repo
```bash
echo 'TFE_HOSTNAME: "testing"' > env-config.yaml
helm template tfe hashicorp/terraform-enterprise --set "env.configFilePath=`pwd`/env-config.yaml"
```
@USA-RedDragon
Copy link
Copy Markdown
Contributor Author

I rebased the change on top of main

@nikolasrieble nikolasrieble merged commit bb481c9 into hashicorp:main Jul 1, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

env.configFilePath and env.secretsFilePath only work when using a local copy of the Helm chart

2 participants